<?php

require_once 'Zend/View/Helper/Abstract.php';

class Core_View_Helper_Controls_SelectTimezone extends Zend_View_Helper_Abstract
{
    /**
     * @param   string  $name   name of the select tag
     * @param   string  $value  value for the select tag
     * @param   array   $attr   attributes for the select tag
     * @return  string  HTML select element
     */
    public function selectTimezone($name, $value, $attribs = null)
    {
        $options = Core_Validate_Timezone::getValidTimezones(null, true);

        $form = new Core_Form();
        $select = $form->createElement('select', $name, array(
            'multiOptions'  => $options,
            'value'         => $value,
        ));
        if (is_array($attribs)) {
            $select->setAttribs($attribs);
        }
        return $select;
    }
}